<?php

namespace backend\modules\finance\controllers;

use common\models\farmerhouse\FarmerhouseHouse;
use Yii;
use backend\modules\farmerhouse\models\FarmerhouseHouseSearch;
use yii\web\Controller;

/**
 * HouseController implements the CRUD actions for FarmerhouseHouse model.
 */
class HouseController extends Controller
{

    /**
     * Lists all FarmerhouseHouse models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new FarmerhouseHouseSearch();

        $params = array_merge(Yii::$app->request->queryParams,["FarmerhouseHouseSearch['status']"=>FarmerhouseHouse::STATUS_AGREE]);
        $dataProvider = $searchModel->search($params);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
}
